<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Title</title>
    <style>
        [v-cloak]{
            display: none;
        }
    </style>
</head>
<body>
<div id="app" v-cloak>
    <input type="text" :value="message" @input="inputChange"><br/>
    <input type="text" v-model="message"><br/>

    <label for="account">
        账号：<input type="text" id="account" v-model="account"/>
    </label><br/>
    <label for="password">
        密码：<input type="text" id="password" v-model="password">
    </label><br/>
    <button v-on:click="loginClick">登录</button>
    <br/>
    <h2>
        {{message}}
    </h2>
</div>
<script src="https://unpkg.com/vue@3"></script>`
<script>
    const app=Vue.createApp({
        data(){
            return{
                message:'Hello Model',
                account:'',
                password:''
            }
        },
        methods:{
            inputChange(e){
                console.log("inputChange:",e.target.value)
                this.message=e.target.value
            },
            loginClick(){
                console.log(this.account,this.password)
            }
        }
    })
    app.mount("#app")
</script>
</body>
</html>